package hpu.e4_demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import hpu.e4_demo.entity.TUsers;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 * 用户表（登录时查询） Mapper 接口
 * </p>
 *
 * @author FFF
 * @since 2025-06-21
 */
@Mapper
public interface TUsersMapper extends BaseMapper<TUsers> {

    @Update("update t_users set password = #{newPassword} ,modify_time = current_timestamp where user_name = #{userName} ")
    Integer update(String userName, String password, String newPassword);

    @Update("update t_users set password = #{Password} where user_name = #{userName}")
    void updateUserPassword(String userName, String Password);

    @Update("update t_users set role = #{role} where user_name = #{userName}")
    int updateRegister(String userName, String role);

}
